package com.sss.gsb.orm.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name="GSB_WS_DEADMAN_CPK")
public class DeadMan implements Serializable{
	
	@Transient
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Transient
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DeadMan other = (DeadMan) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -6180511482308301068L;

	@Id 
	@Column(name="GSB_WS_DEADMAN_CPK_SEQ")
	private BigDecimal id;	
	
	@ManyToOne
	@JoinColumn(name="CIF")
	private Customer customer;
	
	@ManyToOne
	@JoinColumn(name="CID")
	private Loan loan;
		
	@Column(name="HTEACH")
	private String hTeach;
	
	@Column(name="HMEM")
	private String hMem;
	
	@Column(name="C_TYPE",length=3)
	private String type;
	
	@Column(name="T_NAME_SUR")
	private String fullName;
	
	@Column(name="CIZID")
	private String idCard;
	
	@Column(name="AGE")
	private Integer age  ; 
	
	@Column(name="DATE_DATE")
	@Temporal(TemporalType.DATE)
	private Date deadDate;
	
	@Column(name="PROVINCE")
	private String province;
		
	@Column(name="DEAD_REASON")
	private String deadReason;
	
	@Embedded
	private RecordInfo recordInfo;

	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Loan getLoan() {
		return loan;
	}

	public void setLoan(Loan loan) {
		this.loan = loan;
	}

	public String gethTeach() {
		return hTeach;
	}

	public void sethTeach(String hTeach) {
		this.hTeach = hTeach;
	}

	public String gethMem() {
		return hMem;
	}

	public void sethMem(String hMem) {
		this.hMem = hMem;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Date getDeadDate() {
		return deadDate;
	}

	public void setDeadDate(Date deadDate) {
		this.deadDate = deadDate;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getDeadReason() {
		return deadReason;
	}

	public void setDeadReason(String deadReason) {
		this.deadReason = deadReason;
	}

	public RecordInfo getRecordInfo() {
		return recordInfo;
	}

	public void setRecordInfo(RecordInfo recordInfo) {
		this.recordInfo = recordInfo;
	}
	
}
